<?php
// 包含ThinkPHP的引导文件
require_once __DIR__ . '/../../thinkphp/start.php';

// 检查配置值
echo "检查 wechatpay.merchant_private_key_path 配置:\n";
$path = \think\Config::get('wechatpay.merchant_private_key_path');
var_dump($path);

echo "\n检查文件是否存在:\n";
if ($path && file_exists($path)) {
    echo "文件存在: " . $path . "\n";
    echo "文件内容长度: " . filesize($path) . " bytes\n";
} else {
    echo "文件不存在或路径为空\n";
    echo "尝试的路径: " . ($path ? $path : 'NULL') . "\n";
}

echo "\n检查 DOCUMENT_ROOT:\n";
var_dump($_SERVER['DOCUMENT_ROOT']);

echo "\n完整路径构造测试:\n";
$test_path = $_SERVER['DOCUMENT_ROOT'] . '/wxcert/apiclient_key.pem';
echo "构造的路径: " . $test_path . "\n";
echo "文件存在: " . (file_exists($test_path) ? '是' : '否') . "\n";
?>